Repository navigation
csnode: backward sync never asks for more than its buffer holds - #145
Merged
Merged
Conversation
The request window let the blocks asked for and not stored reach the buffer plus one batch, so with slow stores a reply could meet a full buffer. Its extra blocks were dropped and left missing until the batch timed out, which counted against the peer that had sent them: on mainnet, after a restart with slow first stores and the 50 ms turn budget, most peers were left out for an hour and the backfill fell to about 30 blocks/s. A batch is now asked for only when it fits, and blocks without room are asked for again at once without blaming the peer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Seen on the mainnet test node (full rocksdb from the snapshot) after it restarted on master 9752d06: the first stores were slow (15-20 ms a block), the 50 ms turn budget (#140) stored a few blocks per turn, and the buffer filled:
BACKFILL: 800 blocks wait to be stored: the others of … are dropped. The request window allowed up to window + one batch of blocks asked for and not stored (next_ - nextToRequest_ >= windowchecked before adding a batch), so a reply could overrun the buffer. The dropped blocks stayed missing until the batch timed out, which counted as a failure of the peer that had sent them; within 10 minutes 11 peers were "marked for 1 h" and the backfill fell from ~544 to ~30 blocks/s (no neighbour can serve … waiting).Change
next_ - nextToRequest_ + batch > windowstops.SlowStoresNeitherDropBlocksNorMarkPeers: slow stores (12 ms simulated) with a 30 ms budget, batch 20: no drop, no mark, done (fails on master: the window overran the buffer).Test plan
🤖 Generated with Claude Code